package sort.InsertSort_Binary;

public class BinaryInsertSort
{

    public void sort(int[] a){
    	
        for (int i = 1; i < a.length; i++){
            
        	int temp = a[i];
            int low = 0; int high=i-1;
            while (low <= high){
                int mid = (low + high) / 2;
                if (temp<a[mid]){
                      high=mid-1;
                }else{ low=mid+1;}
              }
            for (int j=i-1; j>high; j--){
                a[j+1] =a[j];
              }
            a[high+1] = temp; 
      }
  }
}
